package com.testfileupload.uploadimg.design.intermediary.normal;

public class Stock {
    //刚开始有一百台
    private static int COMPUTER_NUM = 100;

    //库存增加
    public void increase(int num) {
        COMPUTER_NUM = COMPUTER_NUM + num;
        System.out.println("库存数量为"+COMPUTER_NUM);
    }

    public void decrease(int num) {
        COMPUTER_NUM = COMPUTER_NUM - num;
        System.out.println("库存数量为"+COMPUTER_NUM);
    }

    //获取库存数量
    public int getComputerNum() {
        return COMPUTER_NUM;
    }
    //存货压力大，通知采购人员不要采购，销售人员尽快销售
    public void clearStock(){
        Purcchase purcchase = new Purcchase();
        Sale sale = new Sale();
        System.out.println("需要清理的库存为"+COMPUTER_NUM);
        //折价销售
        sale.offSale();
        //采购人员不用继续采购
        purcchase.refuseBuyIBM();
    }
}
